<!-- 【统计信息】管理页面 -->
<template>
  <div class="body">
    <el-row style="margin-top: 100px">
      <el-col span="12">
        <echarts-line id="echartsLine" title="商品入库数量统计图" ref="echartsLine"></echarts-line>
      </el-col>
      <el-col span="12">
        <echarts-pie id="echartsPie" title="商品入库数量占比图" ref="echartsPie"></echarts-pie>
      </el-col>
    </el-row>
    <echarts-bend id="echartsBend" title="商品每日出库频率统计" ref="echartsBend"></echarts-bend>
  </div>
</template>

<script>
    export default {
      mounted() {
        //初始化数据
        this.getList();
      },
      computed: {
      },
      methods: {
        //点击搜索
        handleQuery() {
          this.queryForm.current = 1;
          this.getList();
        },
        //查询列表数据
        getList() {
          this.$request.doGet('/admin/count/getCount', this.queryForm).then(res => {
            if (res.isOk) {
              this.loading = false;
              //柱状图
              const xLine = res.data.line.xData;
              const yLine = res.data.line.yData;
              this.$refs.echartsLine.drawLine(xLine,yLine);
              this.$refs.echartsBend.drawBend(res.data.bend.xData,res.data.bend.yData);
              //饼状图
              const pie = res.data.pie.data;
              this.$refs.echartsPie.drawPie(pie);
            }
          });
        },
      }
    };
</script>
